#include<iostream>

using namespace std;
const int N=1e5+10;
int nums[N];
int main()
{
	//和模板一相比这里所有的有一个误区就是，当n==1||n==0时候，并不会进入循环
	int n,k;cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>nums[i];
	int left=1,right=n;
	while(left<right)
	{
		int mid=left+(right-left)/2;
		if(nums[mid]>=k)
		{
			right=mid;
		}
		else
		{
			left=mid+1;
		}
	}
	int leftflag=left;
	if(n==0||nums[leftflag]!=k) 
	{
		cout<<"{-1,-1}"<<endl;//避免因为不进入循环导致左边界直接等于left导致越界
		return 0;
	}
	int left=1,right=n;
	while(left<right)
	{
		//<=target的最大值
		int mid=left+(right-left+1)/2;
		if(nums[mid]<=k)
		{
			left=mid;
		}
		else
		{
			right=mid-1;
		}
	}
	cout << "{" << leftflag << "," << right << "}" << endl;
}